import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;


//除2!
public class demo17 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),k = in.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b) ->{
            return b-a;
        });
        /**PriorityQueue<Integer> heap1 = new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 -o1;
            }
        });**/
        long sum = 0,x;
        for (int i = 0;i < n;i++){
            x = in.nextInt();
            sum += x;
            if (x % 2 == 0){
                heap.add((int)x);
            }
        }
        while(!heap.isEmpty() && k-- != 0){
            long t =heap.poll() / 2;
            sum -= t;
            if (t % 2 ==0){
                heap.add((int)t);
            }
        }
        System.out.println(sum);
    }







}
